<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<title>simCopyPasteObjects</title>
<link rel="stylesheet" type="text/css" href="../../style.css">
</head>

<body>

<div align="center">
<table class=allEncompassingTable >
 <tr>
  <td >
<p><a href="../../index.html" TARGET="_top"><img src="../images/homeImg.png"></a></p>

<h1>Regular API function</h1>
<h3 class=subsectionBar><a name="simCopyPasteObjects" id="simCopyPasteObjects"></a>simCopyPasteObjects / sim.copyPasteObjects</h3>
<table class=apiTable>
<tr class=apiTableTr> 
<td class=apiTableLeftDescr>
Description 
</td> 
<td class=apiTableRightDescr>Copies and pastes objects, together with all their associated scripts. Duplicate objects might be returned in a different order than the submitted original objects. If you need to copy, but not immediately want to paste the copy, then use <a href="simSaveModel.htm">sim.saveModel</a> and <a href="simLoadModel.htm">sim.loadModel</a>. See also <a href="simRemoveObject.htm">sim.removeObject</a> and <a href="simRemoveModel.htm">sim.removeModel</a>.</td>
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCSyn>
C synopsis
</td> 
<td class=apiTableRightCSyn>simInt simCopyPasteObjects(simInt* objectHandles,simInt objectCount,simInt options)</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCParam>C parameters</td> 
<td class=apiTableRightCParam>
<div><strong>objectHandles</strong>: array containing the handles of the objects to copy and paste. The same array will receive the copied object handles.</div>
<div><strong>objectCount</strong>: the number of handles contained in the objectHandles array.</div>
<div><strong>options</strong>: bit-coded. If bit0 is set (i.e. 1), then whole models will be copied. In that case, all specified objects should be flagged as <em>model base</em>. If bit1 is set (i.e. 2), then all child and customization scripts are stripped away. If bit2 is set (i.e. 4), then all object custom data is stripped away. If bit3 is set (i.e. 8), then all object references are stripped away. If bit4 is set (i.e. 16), then all textures are stripped away. If bit5 is set (i.e. 32), then model tags and DNA information is stripped away.</div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCRet>
C return value
</td> 
<td class=apiTableRightCRet>
<div>-1 if operation was not successful, otherwise the number of handles returned in the objectHandles array.</div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLSyn>
Lua synopsis
</td> 
<td class=apiTableRightLSyn>table[] copiedObjectHandles=sim.copyPasteObjects(table[] objectHandles,int options)</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLParam>Lua parameters</td> 
<td class=apiTableRightLParam>
<div>Similar to the C-function counterpart</div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLRet>
Lua return values
</td> 
<td class=apiTableRightLRet>
<div>Similar to the C-function counterpart</div>
</td> 
</tr> 

<tr class=apiTableTr> 
<td class=remApiTableLeftCParam>
Remote API equiv.
</td> 
<td class=remApiTableRightCParam>
<div>B0-based remote API: <a href="../b0RemoteApi-cpp.htm#simxCopyPasteObjects">simxCopyPasteObjects</a></div>
<div>Legacy remote API: <a href="../remoteApiFunctions.htm#simxCopyPasteObjects">simxCopyPasteObjects</a></div>
</td> 
</tr> 

</table> 


<br>
</td>
</tr>
</table>
</div>
</body>
</html>
